#ifndef URLTREEMODEL_H
#define URLTREEMODEL_H
#include <QAbstractItemModel>
#include <QModelIndex>
#include <QVariant>
#include "urlTreeItem.h"
 
class UrlTreeItem;

class UrlTreeModel : public QAbstractItemModel
{
    Q_OBJECT

public:
    UrlTreeModel(const QString &data, QObject *parent = 0);
    ~UrlTreeModel();

    QVariant data(const QModelIndex &index, int role) const;
    Qt::ItemFlags flags(const QModelIndex &index) const;
    QVariant headerData(int section, Qt::Orientation orientation,
    int role = Qt::DisplayRole) const;
    QModelIndex index(int row, int column,
    const QModelIndex &parent = QModelIndex()) const;
    QModelIndex parent(const QModelIndex &index) const;
    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    int columnCount(const QModelIndex &parent = QModelIndex()) const;
 private:
    void setupModelData(const QStringList &lines, UrlTreeModel *parent);

    UrlTreeModel *rootItem;
};

#endif
 